home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / reqtoolsdev.lha / ReqTools / Glue / MaxonPascal / RT-MaxonPAS.lha / MaxonPASCAL / Source / RTDemoV0.06.p < prev    next >
Text File  |  1994-10-13  |  21KB  |  592 lines

  1. { Program:   Reqtools-Demo
  2.   ~~~~~~~~
  3.   Version:   V0.06 / 08.08.94
  4.   ~~~~~~~~
  5.   Meaning:   Demo for the Reqtools-Interface for
  6.   ~~~~~~~~   KickPascal2.12/OS2
  7.              or MaxonPASCAL3 (compile it)
  8.  
  9.              for Reqtools.library V38 (last 2.2a / V38.1194)
  10.  
  11.   Copyright: © by the cooperation of
  12.   ~~~~~~~~~~
  13.                PackMAN (Falk Zühlsdorff)
  14.  
  15.                 and
  16.  
  17.                Janosh (Jan Stötzer)
  18.  
  19.                for all KP/MP3 Interface / Demos / Includes / Units
  20.  
  21.              This version is FREEWARE (see © Reqtools.library)
  22.  
  23.              © Nico François for the reqtools.library
  24.  
  25.  
  26.   Author:    this Demo and the Unit are written by PackMAN
  27.   ~~~~~~~
  28.   Address:   PackMAN
  29.   ~~~~~~~~   c/o Falk Zühlsdorff
  30.              Lindenberg 66
  31.              98693 Ilmenau/Thuringia
  32.  
  33.              Germany
  34.  
  35.   Comment:   only OS2 or higher now
  36.   ~~~~~~~~                                                           }
  37.  
  38. PROGRAM RTdemo;
  39.  
  40. {--------------------------------------------------------------------}
  41.  
  42. USES REQTOOLS;
  43.  
  44. CONST   up:=chr(10);
  45. TYPE    mystringtype    = string[400];
  46.         mystringtype2   = string[135];
  47. VAR     FileReq         : p_rtFileRequester;
  48.         FontReq         : p_rtFontRequester;
  49.         InfoReq         : p_rtReqInfo;
  50.         ScrnReq         : p_rtScreenModeRequester;
  51.         Buf             : str;
  52.         FName           : str;
  53.         Num             : long;STATIC;
  54.         Col             : long;STATIC;
  55.         Args            : array[0..5] of long;STATIC;
  56.         HStr            : str;
  57.         HStr2           : string[1000];STATIC;
  58.         ret             : long;STATIC;
  59.         ok              : boolean;STATIC;
  60.         Tags            : array[0..6] of TagItem;STATIC;
  61.  
  62.         datname,
  63.         Dirname,
  64.         FileName        : string[108];STATIC;
  65.         FTags           : array[0..3] of TagItem;STATIC;
  66.         flist,tempflist : ^rtfilelist;
  67.  
  68. {--------------------------------------------------------------------}
  69. FUNCTION RTEZ(Text,gadtx:string):long;
  70. VAR tags : array[1..2] of tagitem;STATIC;
  71. BEGIN
  72.  Tags[1]:=TagItem(RT_ReqPos,ReqPos_Pointer);
  73.  Tags[2].ti_tag:=Tag_END;
  74.  RTEZ:=rtEZRequestA(^Text,^gadtx,NIL,NIL,^Tags[1]);
  75. END;
  76. {--------------------------------------------------------------------}
  77. FUNCTION RTEZ1(Text:mystringtype,gadtx:string):long;
  78. VAR tags : array[1..2] of tagitem;STATIC;
  79. BEGIN
  80.  Tags[1]:=TagItem(RT_ReqPos,ReqPos_Pointer);
  81.  Tags[2].ti_tag:=Tag_END;
  82.  RTEZ1:=rtEZRequestA(^Text,^gadtx,NIL,NIL,^Tags[1]);
  83. END;
  84. {--------------------------------------------------------------------}
  85. FUNCTION RTEZ2(Titel:string,text:mystringtype2,gadtx:string,
  86.                pos:byte,x,y:long):long;
  87.  
  88. VAR tags : array[0..7] of tagitem;STATIC;
  89. BEGIN
  90.    Tags[0]:=TagItem(RTEZ_Reqtitle,Long(^titel));
  91.    Tags[1]:=TagItem(RTGS_GadFmt,long(^gadtx));
  92.    Tags[2]:=TagItem(RT_UnderScore,long('_'));
  93.    Tags[3]:=TagItem(RTGS_Flags,GSREQF_CENTERTEXT
  94.                      or GSREQF_HIGHLIGHTTEXT);
  95.    Tags[4]:=TagItem(RT_ReqPos,pos);{if using left-/topoffset not 0..4}
  96.    Tags[5]:=TagItem(RT_LeftOffset,x);
  97.    Tags[6]:=TagItem(RT_TopOffset,y);
  98.    Tags[7].ti_tag:=Tag_END;
  99.    RTEZ2:=rtEZRequestA(^Text,^gadtx,NIL,NIL,^Tags[0]);
  100. END;
  101. {--------------------------------------------------------------------}
  102.  
  103. PROCEDURE RTF;
  104. BEGIN
  105.   FileReq:=ptr(rtAllocRequestA(RT_FileReq, Nil));
  106.   IF FileReq<>Nil
  107.   THEN
  108.    BEGIN
  109.     ret:=rtChangeReqAttr(filereq,^Ftags[0]);
  110.     ret:=rtFileRequestA(FileReq,FileName,"Pick a file",NIL);
  111.     IF ret<>0
  112.      THEN
  113.       BEGIN
  114.        DirName:=FileReq^.Dir;
  115.        IF (DirName<>'') AND (DirName[length(DirName)]<>':')
  116.            AND  ((DirName[length(DirName)]<>'/'))
  117.              THEN datname:=DirName+'/'+Filename
  118.              ELSE datname:=DirName+Filename;
  119.        ret:=rtEZ("You entered:"+datname,"Yes")
  120.       END
  121.      ELSE ret:=rtEZ("You entered nothing","I'm sorry");
  122.     rtFreeRequest(FileReq);
  123.    END;
  124. END;
  125. {--------------------------------------------------------------------}
  126.  
  127. BEGIN
  128.  
  129.  { since Reqtools.unit V0.06 you must check for yourself if:
  130.    OS2 and you must open the reqtools.library first, but
  131.    there are three simple (and better) functions on it...
  132.  
  133.    Why: 1) If a Program should use the Reqtools NOT from
  134.            beginning, like my ZMore.
  135.         2) I want not use the "Halt"-Command of KP/MP3
  136.            and for that reason please use the following two
  137.            routines...
  138.  
  139.    PackMAN 08.08.94   (see also readme for news)                     }
  140.  
  141.  IF NOT V37
  142.  THEN
  143.   BEGIN
  144.    ErrorReq('Need OS2 or higher','OK',NIL);
  145.    exit;
  146.   END;
  147.  
  148.  IF NOT OpenReqtools
  149.   THEN
  150.    BEGIN
  151.     CloseLib(IntuitionBase);
  152.     exit;
  153.    END;
  154.  
  155.  ret:=rtEZ1("Reqtools Demo for Kick-/ MAXONPascal:"+up+
  156.             "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"+up+
  157.             "Version: V0.06 / 08.08.94"+up+up+
  158.             "Written by PackMAN"+up+up+
  159.             "with the Reqtools.library V2.2 (38.1194)"+up+up+
  160.             "'reqtools.library' © by Nico Francois"+up+up+
  161.             "© by the cooperation of"+up+up+
  162.             "  PackMAN (Falk Zühlsdorff)  &"+up+up+
  163.             "  Janosh (Jan Stötzer) Thuringia / GERMANY"+up+up+
  164.             "* Thanx Commodore for the AMIGA-Power *","Yeah !");
  165.  
  166.  ret:=rtEZ("Reqtools.Library offers"+up+"different types of requesters",
  167.                     "Let's see them");
  168.  
  169.  ret:=rtEZ('NUMBER 1:'+up+'The larch :-)','Be serious!');
  170.  
  171.  ret:=rtEZ("Ok, let's be serious..."+up+"NUMBER 1:"+up+
  172.            "String requester function: rtGetString()","Show me");
  173.  
  174.  Buf:='A little bit of text';
  175.  ret:=rtGetStringA(Buf,127,'Enter anything:',Nil,Nil);
  176.  Args[0]:=long(Buf);
  177.  IF ret=0 THEN
  178.     ret:=rtEZ("You entered nothing","I'm sorry")
  179.   ELSE
  180.     ret:=rtEZRequestA('You entered this string: '\10'%s','So I did',Nil,
  181.                       ^Args[0],Nil);
  182.  
  183.   Buf:="Cool, heh ?";
  184.   HStr:="It is possible to have several responses";
  185.   Tags[0]:=TagItem(RTGS_TextFmt,long(HStr));
  186.   HStr:=' OK | New 2.0 feature | Fuck it !! ';
  187.   Tags[1]:=TagItem(RTGS_GadFmt,long(HStr));
  188.   Tags[2].ti_tag:=TAG_END;
  189.  
  190.   ret:=rtGetStringA(Buf,127,"* New for ReqTools 2.0 *",Nil,^Tags[0]);
  191.  
  192.   case ret of
  193.     2 : ret:=rtEZ("Yeah! This is a new Reqtools 2.0 feature.",
  194.                           "OK");
  195.     0 : ret:=rtEZ("Hey! Why don't you like it ???","Ooops");
  196.     otherwise
  197.   END;
  198.  
  199.   ret:=rtEZ('NUMBER 2:'+up+'Number requester'+up+
  200.              'function: rtGetLong()','Show me');
  201.  
  202.   Tags[1]:=TagItem(RTGL_ShowDefault,long(false));
  203.  
  204.   ret:=rtGetLongA (^Num, "Enter a number:", Nil,^Tags[1]);
  205.   Args[0]:= Num;
  206.  
  207.   IF ret=0 THEN
  208.     ret:=rtEZ("You entered nothing","I'm sorry")
  209.   ELSE
  210.     ret:=rtEZRequestA('The number You entered was: '\10'%ld' ,
  211.                       'So it was', Nil, ^Args[0], Nil);
  212.  
  213.   Tags[0]:=TagItem(RTGL_ShowDefault,long(false));
  214.   HStr:="Some text above a Number Gadget";
  215.   Tags[1]:=TagItem(RTGL_TextFmt,long(HStr));
  216.   HStr:='Ok|V38 feature|Cancel';
  217.   Tags[2]:=TagItem(RTGL_GadFmt,long(HStr));
  218.   Tags[3]:=TagItem(TAG_END,0);
  219.  
  220.   ret:=rtGetLongA (^Num, "* New for ReqTools 2.0 *", Nil,^Tags[0]);
  221.  
  222.   case ret of
  223.     0 : ret:=rtEZ("Don't you like it or why do you refuse"+up+
  224.                   "to enter a number ??","Argh");
  225.     2 : ret:=rtEZ("Reqtools V38 makes it possible !","So is it");
  226.     otherwise
  227.   END;
  228.  
  229.   HStr2:="New is also the ability to switch off"+up+
  230.           "the backfill pattern.You can also center"+up+
  231.           "the text above the entry gadget. It's also"+up+
  232.           "possible to allow empty strings to be returned."+up+
  233.           "These new features are also available in"+up+
  234.           "the rtGetLong requester";
  235.   Tags[0]:=TagItem(RTGS_TextFmt,long(^HStr2));
  236.   HStr:="_Great|_Abort";
  237.   Tags[1]:=TagItem(RTGS_GadFmt,long(HStr));
  238.   Tags[2]:=TagItem(RT_UnderScore,long('_'));;
  239.   Tags[3]:=TagItem(RTGS_BackFill,long(false));
  240.   Tags[4]:=TagItem(RTGS_Flags,GSREQF_CENTERTEXT or GSREQF_HIGHLIGHTTEXT);
  241.   Tags[5]:=TagItem(RTGS_AllowEmpty,long(true));
  242.   Tags[6].ti_tag:=TAG_END;
  243.  
  244.   Buf:="";
  245.   ret:=rtGetStringA(Buf,127,"Enter anything",Nil,^Tags[0]);
  246.  
  247.   IF ret=0 THEN
  248.     ret:=rtEZ2("What's up?","You selected 'Abort'."+up+
  249.                "Sick in brain, eh??","Excuse me",0,0,0);
  250.  
  251.   ret:=rtEZ1('NUMBER 3:'+up+'Notification requester, the requester'+up+
  252.              'you have been using all the time!'+up+
  253.              'function: rtEZRequestA()',"Show me more");
  254.  
  255.   ret:=rtEZ('Simplest usage: some body text and'+up+
  256.             'a single centered gadget.',"Got it");
  257.  
  258.   ret:=rtEZ('You can also use two gadgets to'+up+'ask the user something.'+
  259.              up+'Do you understand?',"Of course|Not really");
  260.  
  261.   while ret=0 do BEGIN
  262.     ret:=rtEZ('You are not one of the brightest, are you?'+up+
  263.               'We will try again...',"Ok");
  264.     ret:=rtEZ('You can also use two gadgets to'+up+'ask the user something.'+
  265.              up+'Do you understand?',"Of course|Not really");
  266.   END;
  267.  
  268.   ret:=rtEZ ("Great, we'll continue THEN.", "Fine");
  269.  
  270.   ret:=rtEZ ('You can also put up a requester with'+up+'three choices.'+
  271.              up+'How do you like the demo so far ?',"Great|So so|Rubbish");
  272.  
  273.   case ret of
  274.     0: ret:=rtEZ('Too bad !!!, I really hoped you'+up+
  275.                   'would like it better.',"So what");
  276.     1: ret:=rtEZ('I am glad you like it so much.','Fine');
  277.     2: ret:=rtEZ('Maybe IF you run the demo again'+up+
  278.                   'you will REALLY like it.',"Perhaps");
  279.   END;
  280.  
  281.   HStr2:="The number of responses is not limited to three"+up+
  282.           "as you can see. The gadget are labeled with the"+up+
  283.           "Returncodes from rtEZRequestA()."+up+up+
  284.           "The »3« is printed in bold face, that means that"+up+
  285.           "it is default response which will be choosen by"+up+
  286.           "pressing the »Return« key.";
  287.  
  288.   Tags[0]:=TagItem(RTEZ_DefaultResponse,3);
  289.   Tags[1]:=TagItem(TAG_END,0);
  290.  
  291.   ret :=rtEZRequestA (^HStr2," 1 | 2 | 3 | 4 | 5 | 0 ", Nil, Nil,^Tags[0]);
  292.  
  293.   Args[0]:=long(ret);
  294.   ret:=rtEZRequestA('You picked %ld',"How true",Nil,^Args[0],Nil);
  295.  
  296.   Tags[0]:=TagItem(RT_Underscore,long('_'));;
  297.   Tags[1]:=TagItem(TAG_END,0);
  298.  
  299.   ret:=rtEZRequestA('New for Rel. 2.0 of ReqTools(V38) is'\10'the possibility to define characters in the'\10'buttons as keyboard shortcuts.'\10'As you can see these characters are underlined.',
  300.                     "_Great|_Fantastic|_Swell|Oh _Boy",Nil, Nil,^Tags[0]);
  301.  
  302.   ret:=rtEZRequestA('Note that pressing shift while still holding'\10'down the key will cancel the shortcut.',
  303.                     "_Great|_Fantastic|_Swell|Oh _Boy",Nil, Nil,^Tags[0]);
  304.  
  305.   Tags[1]:=TagItem(TAG_END,0);
  306.   Args[0]:=5;
  307.   HStr:="five";
  308.   Args[1]:=long(HStr);
  309.  
  310.   ret:=rtEZRequestA ("You may also use C-style formatting codes in the body text."\10"Like this:"\10\10"The number %%ld is written %%s. will give:"\10\10"The number %ld is written %s."\10\10"IF you also pass '5' and 'five' to rtEZRequestA().",
  311.                      "_Proceed", Nil, ^Args[0],^Tags[0]);
  312.  
  313.   Tags[0]:=TagItem(RT_IDCMPFlags,DISKINSERTED);
  314.   Tags[1]:=TagItem(RT_Underscore,long('_'));
  315.   Tags[2]:=TagItem(TAG_END,0);
  316.  
  317.   ret:=rtEZRequestA ("It is also possible to pass extra IDCMP flags"\10"that will satisfy rtEZRequestA(). This requester"\10"has had DISKINSERTED passed to it."\10"(Try inserting a disk).",
  318.                      "_Continue", Nil, Nil,^Tags[0]);
  319.  
  320.   IF ret=DISKINSERTED THEN
  321.     ret:=rtEZ("You inserted a disk.","I did")
  322.   ELSE
  323.     ret:=rtEZ("You used the 'Continue' gadget"+up+
  324.                "to satisfy the requester.","I did");
  325.  
  326.   Tags[0]:=TagItem(RT_ReqPos,REQPOS_TOPLEFTSCR);
  327.   Tags[1]:=TagItem(RT_Underscore,long('_'));
  328.   Tags[2]:=TagItem(TAG_END,0);
  329.  
  330.   ret:=rtEZRequestA("Finally, it is possible to specify the position"\10"of the requester."\10"E.g. at the top left of the screen, like this."\10"This works for all requesters, not just rtEZRequestA()!",
  331.                     "_Amazing",Nil,Nil,^Tags[0]);
  332.  
  333.   Tags[0]:=TagItem(RT_ReqPos,REQPOS_CENTERSCR);
  334.   Tags[2]:=TagItem(TAG_END,0);
  335.  
  336.   ret:=rtEZ2("RTDemo V0.06 by PackMAN",
  337.             "You can also change the windowtitel,"+up+up+
  338.             "(Default: Information)"+up+up+
  339.             "center the text and use the requester"+up+up+
  340.             "on your own position: x=25 / y=20","Fantastic",5,25,20);
  341.  
  342.   ret:=rtEZRequestA("Alternatively, you can center the"\10"requester on the screen."\10"Check out 'reqtools.doc' for all the possibilities.",
  343.                     "_Yo, I'll do that",Nil,Nil,^Tags[0]);
  344.  
  345.   Tags[0]:=TagItem(RT_Underscore,long('_'));
  346.   Tags[1]:=TagItem(TAG_END,0);
  347.  
  348.   ret:=rtEZRequestA("NUMBER 4:"\10"File requester"\10"function: rtFileRequest()",
  349.                     "_Demonstrate",Nil,Nil,^Tags[0]);
  350.  
  351. {------------------------------------------------------------------------}
  352. {                       *** File Requester ***                           }
  353. {------------------------------------------------------------------------}
  354. Filename:='';
  355. datname:='';
  356. Dirname:='';
  357. FTags[0]:=TagItem(RTFI_Dir,long(^Dirname));
  358. FTags[1].ti_tag:=Tag_Done;
  359. RTF;
  360. ret:=rtEZ("If you selected a file you will"+up+
  361.           "see the buffering of the entry...","Please");
  362. RTF;
  363.  
  364. ret:=rtEZRequestA("You can also change the height"\10"of the file requester",
  365.                     "Wow",Nil,Nil,Nil);
  366.  
  367. FileReq:=ptr(rtAllocRequestA(RT_FILEREQ,Nil));
  368.  
  369. Tags[0]:=TagItem(RTFI_Height,250);
  370. Tags[1]:=TagItem(TAG_END,0);
  371.  
  372. IF FileReq<>Nil THEN
  373.  BEGIN
  374.   FName:="";
  375.   ret:=0;
  376.   ret:=rtFileRequestA(FileReq,FName,"Pick a file",^Tags[0]);
  377.   IF ret<>0 THEN
  378.    BEGIN
  379.     Args[0]:=long(FName);
  380.     Args[1]:=long(FileReq^.Dir);
  381.     ret:=rtEZRequestA ("You picked the file:"\10"%s"\10"in directory:"\10"%s",
  382.                        "Right",Nil,^Args[0],Nil);
  383.    END
  384.   ELSE
  385.    ret:=rtEZ ("You didn't pick a file.","No");
  386.   rtFreeRequest(FileReq);
  387.  END
  388.   ELSE
  389.    ret:=rtEZ("Out of memory!","Oh boy!");
  390.  
  391.   ret:=rtEZRequestA("The file requester can be used"\10"as a directory requester as well."\10"You can even change the text"\10"in the 'OK'-Gadget",
  392.                     "Let's see that",Nil,Nil,^Tags[0]);
  393.  
  394.   FileReq:=ptr(rtAllocRequestA(RT_FileReq,Nil));
  395.  
  396.   Tags[0]:=TagItem(RTFI_Flags,FREQF_NOFILES);
  397.   HStr:="_Remove";
  398.   Tags[1]:=TagItem(RTFI_OkText,long(HStr));
  399.   Tags[2]:=TagItem(RT_UnderScore,long('_'));
  400.   Tags[3]:=TagItem(TAG_END,0);
  401.  
  402.   IF FileReq<>Nil THEN BEGIN
  403.     ret:=0;
  404.     ret:=rtFileRequestA(FileReq,FName,"Remove a directory",^Tags[0]);
  405.     Args[0]:=long(FileReq^.Dir);
  406.     IF ret=1 THEN
  407.        ret:=rtEZRequestA ("You picked the directory: %s",
  408.                          "Right",Nil,^Args[0],Nil)
  409.     ELSE
  410.       ret:=rtEZ ("You didn't pick a directory.","No");
  411.     rtFreeRequest(FileReq);
  412.   END ELSE
  413.     ret:=rtEZ ("Out of memory!","Oh boy!");
  414.  
  415.  
  416.   
  417.  
  418. {------------------------------------------------------------------------}
  419. {                       *** Font Requester ***                           }
  420. {------------------------------------------------------------------------}
  421.  
  422.   ret:=rtEZ("NUMBER 5:"+up+"Font requester"+up+
  423.              "function: rtFontRequest()","Show me !");
  424.  
  425.   FontReq:=ptr(rtAllocRequestA(RT_FONTREQ,Nil));
  426.  
  427.   IF FontReq<>Nil THEN BEGIN
  428.     FontReq^.Flags:=FREQF_STYLE or FREQF_COLORFONTS;
  429.     ok:=rtFontRequestA(FontReq,"Selcet a font",Nil);
  430.     IF ok THEN BEGIN
  431.       Args[0]:=long(FontReq^.Attr.ta_Name);
  432.       Args[1]:=long(FontReq^.Attr.ta_YSize);
  433.       ret:=rtEZRequestA("You picked the font:"\10"%s"\10"with size:"\10"%ld Pixels",
  434.                         "That's true",Nil,^Args[0],Nil);
  435.     END ELSE
  436.       ret:=rtEZ("Wasn't there a font you liked ?","Nope");
  437.     rtFreeRequest(FontReq);
  438.   END ELSE
  439.     ret:=rtEZ("Out of memory!","Oh boy!");
  440.  
  441.  
  442. {------------------------------------------------------------------------}
  443. {                      *** Palette Requester ***                         }
  444. {------------------------------------------------------------------------}
  445.  
  446.   Tags[0]:=TagItem(RT_Underscore,long('_'));
  447.   Tags[1]:=TagItem(TAG_END,0);
  448.  
  449.   ret:=rtEZRequestA ("NUMBER 6:"\10"Palette requester"\10"function: rtPaletteRequest()",
  450.                      "_Proceed",Nil,Nil,^Tags[0]);
  451.  
  452.   Col:=rtPaletteRequestA("Change palette",Nil,Nil);
  453.   IF Col=-1 THEN
  454.     ret:=rtEZRequestA ("You canceled."\10"No nice colors to be picked ?",
  455.                        "_Nah",Nil,Nil,^Tags[0])
  456.   ELSE
  457.     ret:=rtEZRequestA ("You picked color number %ld.","_Sure did",
  458.                        Nil,^Col,^Tags[0]);
  459.  
  460. {------------------------------------------------------------------------}
  461. {                          *** Volume-Requester                          }
  462. {------------------------------------------------------------------------}
  463.  
  464.   ret:=rtEZ("NUMBER 7: The Volume / Disk-Requester","Perfect");
  465.  
  466.   FileReq:=ptr(rtAllocRequestA(RT_FILEREQ,Nil));
  467.  
  468.   Tags[0]:=TagItem(RTFI_VolumeRequest,VREQF_ALLDISKS or VREQF_NOASSIGNS);
  469.   HStr:="Un_mount";
  470.   Tags[1]:=TagItem(RTFI_OkText,long(HStr));
  471.   Tags[2]:=TagItem(RT_UnderScore,long('_'));
  472.   Tags[3]:=TagItem(TAG_END,0);
  473.  
  474.   IF FileReq<>Nil THEN BEGIN
  475.     ret:=0;
  476.     ret:=rtFileRequestA(FileReq, FName, "Unmount a device",^Tags[0]);
  477.     Args[0]:=long(FileReq^.Dir);
  478.     IF ret=1 THEN
  479.       ret:=rtEZRequestA("You picked the device: %s","Right",Nil,^Args[0],Nil)
  480.     ELSE
  481.       ret:=rtEZ("You didn't pick a device.","Ooops");
  482.     rtFreeRequest (FileReq);
  483.   END ELSE
  484.     ret:=rtEZ("Out of memory!","Oh boy!");
  485.  
  486.  
  487. {------------------------------------------------------------------------}
  488. {                          *** MultiSelectFileReq ***                    }
  489.  
  490. {                      New since V0.04 © by PackMAN  02.06.94               }
  491. {------------------------------------------------------------------------}
  492. ret:=rtEZ1("NUMBER 8: The MultiSelectFileRequester"+up+up+
  493.            "          The file requester has the ability"+up+
  494.            "          to allow you to pick more than one"+up+
  495.            "          file (use SHIFT to extended-select)."+up+
  496.            "          Note the extra gadgets you get." ,"Interesting");
  497. Fname:='';
  498. datname:='';
  499. Dirname:='';
  500. FTags[0]:=TagItem(RTFI_Dir,long(^Dirname));
  501. FTags[1].ti_tag:=Tag_Done;
  502. FTags[2]:=TagItem(RTFI_Flags,FREQF_MULTISELECT);
  503. FTags[3].ti_tag:=Tag_Done;
  504.  
  505. FileReq:=ptr(rtAllocRequestA(RT_FileReq, Nil));
  506. IF FileReq<>Nil
  507.  THEN
  508.   BEGIN
  509.    ret:=rtChangeReqAttr(filereq,^Ftags[0]);
  510. {*}flist:=ptr(rtFileRequestA(FileReq,FName,"Pick some files",^Ftags[2]));
  511.    IF flist<>NIL
  512.     THEN
  513.      BEGIN
  514.       tempflist:=flist;
  515.       ret:=rtEZ1("You selected some files, this is"+up+
  516.                   "the first one: "+tempflist^.name+up+
  517.                   "All the files are returned as a linked"+up+
  518.                   "list (see RTDemo.p or demo.c)","Aha");
  519.       END
  520.      ELSE ret:=rtEZ("You didn`t pick some files","I don`t no why !");
  521.  
  522.   {tempflist:=flist;
  523.  
  524.     WHILE tempflist<>NIL DO   {a routine to understand, not used here}
  525.      BEGIN
  526.       writeln(tempflist^.name);
  527.       tempflist:=tempflist^.next;
  528.      END;
  529.    }
  530.     rtFreeFileList(Flist);
  531.     rtFreeRequest(FileReq);
  532.    END
  533.   ELSE ret:=rtEZ("Out of memory!","Oh boy!");
  534.  
  535. {------------------------------------------------------------------------}
  536. {                     *** Screenmode Requester ***                       }
  537. {------------------------------------------------------------------------}
  538.  
  539.   ret:=rtEZ("NUMBER 9:"+up+"ScreenMode requester"+up+
  540.             "function: rtScreenModeRequestA()","Proceed");
  541.  
  542.   ScrnReq:=ptr(rtAllocRequestA(RT_SCREENMODEREQ,Nil));
  543.   IF ScrnReq<>Nil THEN
  544.    BEGIN
  545.     Tags[0]:=TagItem(RTSC_Flags,SCREQF_DEPTHGAD or SCREQF_SIZEGADS or
  546.                           SCREQF_AUTOSCROLLGAD or SCREQF_OVERSCANGAD);
  547.     Tags[1]:=TagItem(RT_UnderScore,long('_'));
  548.     Tags[2]:=TagItem(TAG_END,0);
  549.  
  550.     ok:=rtScreenModeRequestA(ScrnReq,"Pick a screenmode",^Tags[0]);
  551.  
  552.     Args[0]:=long(ScrnReq^.DisplayID);
  553.     Args[1]:=long(ScrnReq^.DisplayWidth);
  554.     Args[2]:=long(ScrnReq^.DisplayHeight);
  555.     Args[3]:=long(ScrnReq^.DisplayDepth);
  556.     Args[4]:=long(ScrnReq^.OverscanType);
  557.     IF (Boolean(ScrnReq^.AutoScroll)) THEN BEGIN
  558.       HStr:="On";
  559.       Args[5]:=long(HStr)
  560.     END ELSE BEGIN
  561.       HStr:="Off";
  562.       Args[5]:=long(HStr);
  563.     END;
  564.     IF ok THEN
  565.       ret:=rtEZRequestA("You picked this mode:"\10"ModeID    : 0x%lx"\10"Size      : %ld x %ld"\10"Depth     : %ld"\10"Overscan  : %ld"\10"AutoScroll: %s",
  566.                         "Right",Nil,^Args[0],Nil)
  567.     ELSE
  568.       ret:=rtEZ("You didn't pick a screen mode.","Sorry");
  569.     rtFreeRequest(ScrnReq);
  570.   END ELSE
  571.     ret:=rtEZ("Out of memory!","Oh boy!");
  572.  
  573.  
  574.  
  575.   ret:=rtEZ("Finishing the Demo V0.06... Hope you enjoyed it.",
  576.                     "Really Great !");
  577.  
  578.   IF RTBase<>NIL        THEN CloseLibrary(RTBase);
  579.   IF IntuitionBase<>NIL THEN CloseLib    (IntuitionBase);
  580. END.
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.